#ifndef _STRAWGUI_DRAW_CONTEXT_H_
#define _STRAWGUI_DRAW_CONTEXT_H_

#include "sMath.h"
#include "sTransform.h"
#include "sDrawSurface.h"

namespace sgui
{
namespace engine
{

	class sEngine;

	class sDrawContext
	{
	protected:
		math::sRectf			m_rect;
		math::sRectf			m_drawRect;
		math::sPointf			m_scroll;
		const sDrawContext*		m_parent;
		bool					m_clipRect;
	public:
		math::sRectf&			getRect();
		math::sPointf&			getScroll();
		
		bool					getClipRect() const;
		const math::sRectf&		getRect() const;
		const math::sRectf&		getDrawRect() const;
		const math::sPointf&	getScroll() const;
		
		virtual bool beginDraw(sDrawSurface& surface) const = 0 ;
		virtual void endDraw(sDrawSurface& surface) const = 0;
		virtual void updateDraw(sDrawSurface& surface) const = 0;

		virtual void pushTransform(const obj::sTransform& transform) const = 0;
		virtual void popTransform() const = 0;

		sDrawContext(const sEngine& engine, const math::sRectf& rect, const sDrawContext* parentContext, bool clipRect = true);
		sDrawContext(const sEngine& engine, const math::sRectf& rect, bool clipRect = true);
		virtual ~sDrawContext();
	};

};
};

#endif